<template>
	<div class="tuWenLinks-box">
		<ul>
			<li v-for="v in imgArraryData" @click="clickImg(v.imgLink)">
				<img :src="v.img + '?x-oss-process=image/resize,m_fixed,h_196,w_330'" alt="" />
			</li>
		</ul>
	</div>
</template>

<script>
export default {
	data() {
		return {
			ownerid: this.$route.params.ownerid, // 主播id
			imgArraryData: [],
		}
	},
	created: function () {
		this.getTuWenDataImg()
		//this.$store.dispatch("hideNav");
		this.$store.dispatch("isBoxTrue");
	},
	activated: function () {
		var TabArray;
		if (sessionStorage.getItem("liveNavtable")) {
			TabArray = JSON.parse(sessionStorage.getItem("liveNavtable"))
		} else {
			TabArray = this.$store.state.liveNavTabArray
		}
		for (var i = 0; i < TabArray.length; i++) {
			if (TabArray[i].type == 5) {
				this.$store.dispatch("setRoomTab", ++i)
			}
		}
	},
	methods: {
		getTuWenDataImg() {
			let _this = this;
			_this.$http.get('/h5live/getImgLinkList?anchor=' + _this.ownerid).then((res) => {
				//console.log(res.data.data);
				if (res.data.code == '000000') {
					_this.imgArraryData = res.data.data;
				}
			}, (err) => {
				console.log(err);
			})
		},
		clickImg(imglink) {
			if (imglink) {
				if (window.terminal.isZxjtqhApp) {
					fun.zxjtqhLinkUrl(imglink)
				} else {
					window.location.href = imglink;
				}
			}
		}
	}
}
</script>

<style scoped="scoped">
.tuWenLinks-box {
	width: 750px;
	height: calc(100vh - 564px);
	background: white;
	float: left;
}

.tuWenLinks-box ul {
	width: 100%;
	height: calc(100vh - 564px);
	padding: 0 2.5%;
	font-size: 0;
	padding-bottom: 300px;
	float: left;
	overflow-y: scroll;
}

.tuWenLinks-box ul li {
	width: 48.6%;
	margin-top: 22px;
	box-sizing: border-box;
	float: left;
}

.tuWenLinks-box ul li:nth-of-type(odd) {
	margin-right: 18px;
}

.tuWenLinks-box ul li img {
	width: 100%;
	height: 196px;
	border-radius: 10px;
}
</style>